package com.cis.fingerprint.core;

/**
 * 指令码管理
 */
public class CodeManager {

    /**
     * 包类型
     */
    public static final byte B_PID_COMMAND = 0x01;
    public static final byte B_PID_DATA = 0x02;
    public static final byte B_PID_RESPONSE = 0x07;
    public static final byte B_PID_LAST_DATA = 0x08;

    /**
     * 相关
     */
    public static final byte B_ACK_RET_PID_PST = 0X06;
    public static final byte B_ACK_RET_TYPE_PST = 0X09;
    public static final byte B_ACK_RET_PACKAGE_PRE_CONTENT_SIZE = 0X09;
    public static final int N_RESPONSE_SIZE = 12;//返回类型包大小

    /**
     * 命令码
     */
    public static final byte B_COMMAND_GETIMG = 0x01; //获取用于验证的指纹图像
    public static final byte B_COMMAND_GENCHAR = 0x02; //从指纹图像提取特征
    public static final byte B_COMMAND_MATCH = 0x03; //对比两个指纹特征
    public static final byte B_COMMAND_SEARCH = 0x04; //在所有或指定的部分已注册的指纹特征库范围内，进行指纹识别比对
    public static final byte B_COMMAND_REG_MODEL = 0x05; //将2~3个指纹特征合并成1个指纹注册模板
    public static final byte B_COMMAND_STORE_MODEL = 0x06; //将注册模板存入FLASH
    public static final byte B_COMMAND_LOAD_CHAR = 0x07; //从FLASH读出一个模板到缓存中
    public static final byte B_COMMAND_UP_CHAR = 0x08;  //将缓冲区的特征模板上传到上位机
    public static final byte B_COMMAND_DOWN_CHAR = 0x09;  //从上位机下载一个特征模板到缓冲区
    public static final byte B_COMMAND_UP_IMAGE = 0x0A;  //将缓冲区的指纹图像上传到上位机
    public static final byte B_COMMAND_DELETE_CHAR = 0x0C;  //从FLASH中删除一个特征
    public static final byte B_COMMAND_EMPTY = 0x0D; //清空FLASH指纹数据库
    public static final byte B_COMMAND_SET_SYSPARA = 0x0E; //设置模块参数
    public static final byte B_COMMAND_READ_SYSPARA = 0x0F;  //读取模块参数
    public static final byte B_COMMAND_SET_PWD = 0x12;  //设置模块密码
    public static final byte B_COMMAND_VFY_PWD = 0x13;  //验证模块密码
    public static final byte B_COMMAND_WRITE_NOTE_PAD = 0x18;  //写入一条32字节记事本
    public static final byte B_COMMAND_READ_NOPE_PAD = 0x19;  //读取一条32字节记事本
    public static final byte B_COMMAND_TEMPLATE_NUM = 0x1D;  //读取数据库中模板数量
    public static final byte B_COMMAND_READ_CON_LIST = 0x1F;  //读取数据库中模板的可用标记
    public static final byte B_COMMAND_AUTO_ENROLL = 0x31;  //自动注册指纹
    public static final byte B_COMMAND_AUTO_IDENTIFY = 0x32;  //自动验证指纹

    /**
     * 下位机应答码
     */
    public static final byte B_ACK_RET_OK = 0X00;//成功
    public static final byte B_ACK_RET_INVALID_PACKET = 0X01;//无效数据包.
    public static final byte B_ACK_RET_NO_FINGER = 0X02;//传感器未检测到手指.
    public static final byte B_ACK_RET_GET_IMG_FAIL = 0X03;//获取图像出错

}
